package test.aop;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

public class TimeBookProxy 
{
   private Logger logger = Logger.getLogger(this.getClass().getName()); 
   private TimeBookInterface timeBookInterface; 
   //在该类中针对前面的接口TimeBookInterface编程，而不针对具体的类
     public TimeBookProxy(TimeBookInterface timeBookInterface) 
     { 
         this.timeBookInterface = timeBookInterface; 
     }
          //实际业务处理
          public void doAuditing(String name) 
           { 
                   logger.log(Level.INFO, name + " 开始审核数据...."); 
                   timeBookInterface.doAuditing(name);    //调用方法
                   logger.log(Level.INFO, name + " 审核数据结束...."); 
          }
}